package mvc.effects.impl;

import java.awt.geom.AffineTransform;
import java.awt.image.AffineTransformOp;
import java.awt.image.BufferedImage;
import java.awt.image.BufferedImageOp;

import mvc.effects.INonParameterizedEffect;

@SuppressWarnings("nls")
public class HorizontalFlipEffect implements INonParameterizedEffect {

	private final String EFFECT_NAME = "Horizontal Flip";

	public HorizontalFlipEffect() {
	}

	@Override
	public BufferedImage applyEffect(BufferedImage img) {

		AffineTransform aft = AffineTransform.getScaleInstance(-1, 1);
		aft.translate(-img.getWidth(), 0);
		BufferedImageOp horizontalFlip = new AffineTransformOp(aft, null);

		return horizontalFlip.filter(img, null);
	}

	@Override
	public BufferedImageOp getEffect() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String toString() {

		return EFFECT_NAME;
	}

}
